using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Outpatient.Doman.Smart
{
    /// <summary>
    /// 用户收藏实体类
    /// </summary>
    [Table("UserCollection")]
    public class UserCollection
    {
        /// <summary>
        /// 收藏唯一标识 - 主键，自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int CollectionId { get; set; }

        /// <summary>
        /// 用户ID - 外键
        /// </summary>
        [Required]
        public int UserId { get; set; }

        /// <summary>
        /// 就医指南Id  外键
        /// </summary>
        [Required]
        public int GuideId { get; set; }

        /// <summary>
        /// 收藏的项目类型，如"consultation"或"guide"
        /// </summary>
        [Required]
        [StringLength(20)]
        public string ItemType { get; set; } = string.Empty;

        /// <summary>
        /// 收藏时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.Now;

        /// <summary>
        /// 导航属性 - 关联的用户信息
        /// </summary>
        [ForeignKey("UserId")]
        public virtual User? User { get; set; }

        /// <summary>
        /// 导航属性 - 关联的指南信息
        /// </summary>
        [ForeignKey("GuideId")]
        public virtual Guide? Guide { get; set; }
    }
} 